package com.frp.protocol;

import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * 新建工作连接响应消息
 */
public class NewWorkConnRespMessage extends Message {
    @JsonProperty("proxy_name")
    private String proxyName;
    
    @JsonProperty("error")
    private String error;
    
    public NewWorkConnRespMessage() {
        super(MessageType.NewWorkConnResp);
    }
    
    public NewWorkConnRespMessage(String proxyName, String error) {
        super(MessageType.NewWorkConnResp);
        this.proxyName = proxyName;
        this.error = error;
    }
    
    // Getters and Setters
    public String getProxyName() { return proxyName; }
    public void setProxyName(String proxyName) { this.proxyName = proxyName; }
    
    public String getError() { return error; }
    public void setError(String error) { this.error = error; }
    
    public boolean isSuccess() {
        return error == null || error.isEmpty();
    }
}